dnl Process this file with autoconf to produce a configure script.

dnl *** Check that required autoconf version is installed, and init it ***
AC_PREREQ(2.53)
AC_INIT(configure.ac)

dnl *** Component versions ***
GMOF_VERSION=0.1
AC_SUBST(GMOF_VERSION)

dnl *** Required components and their versions ***
GTKMM_REQUIRED=2.10
CPPUNIT_REQUIRED=1.10

AC_SUBST(GTKMM_REQUIRED)
AC_SUBST(CPPUNIT_REQUIRED)

dnl *** Initalization ***
AM_INIT_AUTOMAKE(gmof, $GMOF_VERSION)
AM_MAINTAINER_MODE

dnl *** Set generic cflags ***
CFLAGS_WARNINGS="-Wall -Wunused"
if test "x$GCC" = xyes; then
	CFLAGS_WARNINGS=""
fi

dnl *** Disable deprecated APIs ***
AC_ARG_ENABLE(deprecated,
	[  --disable-deprecated    Disable deprecated APIs],
	[ if test x$enablevar = xno; then
	  DEPRECATED_FLAGS="-DG_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED -DGNOME_DISABLE_DEPRECATED"
	  fi ],
	[ DEPRECATED_FLAGS="" ])
AC_SUBST(DEPRECATED_FLAGS)

dnl *** Check for pkgconfig ***
AC_PATH_PROG(PKGCONFIG_CONFIG, pkg-config,no)
if test x$PKGCONFIG_CONFIG = xno; then
  AC_MSG_ERROR(Please install the pkg-config package from http://www.freedesktop.org/software/pkgconfig/)
fi

dnl *** Check for common components ***
PKG_CHECK_MODULES(GTKMM, gtkmm-2.4 >= $GTKMM_REQUIRED)
AC_SUBST(GTKMM_CFLAGS)
AC_SUBST(GTKMM_LIBS)

PKG_CHECK_MODULES(CPPUNIT, cppunit >= $CPPUNIT_REQUIRED)
AC_SUBST(CPPUNIT_CFLAGS)
AC_SUBST(CPPUNIT_LIBS)

dnl *** Check for basic stuff ***
AC_PROG_CXX
AC_ISC_POSIX
AC_HEADER_STDC
AM_DISABLE_STATIC
AM_PROG_LIBTOOL
AC_TYPE_SIGNAL

dnl *** Checks for typedefs, structures, and compiler characteristics ***
AC_C_CONST
AC_OBJEXT
AC_EXEEXT

AC_TYPE_SIZE_T
AC_TYPE_OFF_T

dnl *** Set generic cflags ***
CFLAGS_WARNINGS=""
if test "x$GCC" = xyes; then
	CFLAGS_WARNINGS="-Wall -Wunused"
fi
AC_SUBST(CFLAGS_WARNINGS)
	
dnl *** Output ***
AC_OUTPUT([ Makefile
src/Makefile
src/gmof.pc
test/Makefile
])
